<%--
 - Copyright (c) 2009-2011 ETCORE Labs. All rights reserved. 
 - 
 - This software is the confidential and proprietary information of ETCORE Labs. 
 - You shall not disclose such confidential information and shall use it only
 - in accordance with the terms of the license agreement you entered into
 - with ETCORE Labs.
 -
 - Support can be obtained from support forums at:
 - http://www.etcore.com/
 -
 - @author: ETCORE GroupTalk developers
 -
 --%>
<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib uri="http://jakarta.apache.org/taglibs/core" prefix="c"%>
<%@ taglib uri="http://www.etcore.com/grouptalk" prefix="grouptalk"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<c:set var="platformId" value="1" />
<c:set var="platformName" value="${context.platform1}" />
<c:set var="directoriesId" value="directories1" />
<c:set var="rootGroupsId" value="rootGroups1" />
<c:set var="rootGroupsSizeId" value="rootGroups1Size" />
<c:if test="${not empty nav && nav eq '1' }">
	<c:set var="platformId" value="11" />
	<c:set var="platformName" value="${context.nav1}" />
	<c:set var="directoriesId" value="directories11" />
	<c:set var="rootGroupsId" value="rootGroups11" />
	<c:set var="rootGroupsSizeId" value="rootGroups11Size" />
</c:if>
<html>
<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script>
function showSub(id){

	var submenu=document.getElementById('sub'+id);
	var parentmenu=document.getElementById('root'+id);
	var gif=document.getElementById('img'+id);
 
	if(	submenu.style.display=="none")  {
		submenu.style.display="block";
		submenu.style.left=parentmenu.style.left;
		gif.src="/group/images/minus.gif";
 
	}
	else {
		submenu.style.display="none";
		gif.src="/group/images/plus.gif";
 
	}
	

}



</script>
</head>
<body>
<div
	style="height: 500px; overflow-y: auto; border: 1px solid #D6E0FC; margin-top: 5px;margin-right: 5px;">
<table width=185 cellSpacing=0 cellPadding=0 width=100% style="table-layout:fixed;">
	<tr>
		<td><A style="font-weight: bold"
			href="/group/news<c:out value="${context.postfix}" />?nav=<c:out value='${nav}' />"><c:out
			value="${platformName}" /></A></td>
	</tr>

	<c:forEach var="directory" items="${requestScope[directoriesId]}">
		<tr>
			<td>
			<div>

			<div id="root<c:out value='${directory.id }' />"
				style="height: 25px; cursor: pointer"
				onclick="showSub('<c:out value='${directory.id }' />')">
			<table>
				<tr>
					<td><img id="img<c:out value='${directory.id }' />"
						<c:if test="${directory.id!=currentDirectory.id }">
												src="/group/images/plus.gif"</c:if>
						<c:if test="${directory.id==currentDirectory.id }">
												src="/group/images/minus.gif"</c:if>
						border=0 /><img src="/group/images/dir.gif" border=0 /></td>
					<td nowrap><c:out value='${directory.name}' /></td>
				</tr>
			</table>

			</div>
			<div id="sub<c:out value='${directory.id }' />" class="sub"
				style="position: relative; margin-left: 0; <c:if test="${directory.id!=currentDirectory.id }">display: none;</c:if> width: 180px; z-index: 1;">
			<table>
				<c:set var="groups" value="${directory.id }groups" />
				<c:forEach var="groupItem" items="${requestScope[groups]}">
					<tr>
						<td nowrap style="overflow:hidden"><img src="/group/images/sub.gif" border=0><c:if
							test="${!context.encryptedUrl1}">
							<a
								<c:if test="${groupItem.id==param.gid||groupItem.id==group.id }">style="color:red;font-weight:bold;"</c:if>
								href="/group/newsView<c:out value='${context.postfix}'/>?gid=<c:out value='${groupItem.id }'/>"><c:if
														test="${not empty groupItem.pic&&fn:indexOf(groupItem.pic,'upload')!=-1 }">
														<img src="/${groupItem.pic}" width=12 border=0 />
													</c:if><c:if
														test="${empty groupItem.pic||fn:indexOf(groupItem.pic,'upload')==-1 }">
														<img src="/group/images/info.gif" width=12 border=0 />
													</c:if><c:out
								value='${groupItem.name }' /></a>
						</c:if><c:if test="${context.encryptedUrl1}">
							<c:set var='urlFragmentStr' value='?gid=${groupItem.id}' />
							<c:set var='urlFragment'
								value='${grouptalk:getEncryptedStr(urlFragmentStr)}' />
							<a
								<c:if test="${groupItem.id==param.gid||groupItem.id==group.id }">style="color:red;font-weight:bold;"</c:if>
								href="/group/newsView<c:out value='${context.postfix }'/>/~<c:out value='${urlFragment}'/>"><c:if
														test="${not empty groupItem.pic&&fn:indexOf(groupItem.pic,'upload')!=-1 }">
														<img src="/${groupItem.pic}" width=12 border=0 />
													</c:if><c:if
														test="${empty groupItem.pic||fn:indexOf(groupItem.pic,'upload')==-1 }">
														<img src="/group/images/info.gif" width=12 border=0 />
													</c:if><c:out
								value='${groupItem.name }' /></a>
						</c:if></td>
					</tr>
				</c:forEach>
			</table>
			</div>

			</div>
			</td>
		</tr>
	</c:forEach>
	<c:forEach var="groupItem" items="${requestScope[rootGroupsId]}">
		<tr>
			<td nowrap style="height: 25px; padding-left: 10px" style="overflow:hidden"><c:if
				test="${!context.encryptedUrl1}">
				<a
					<c:if test="${groupItem.id==param.gid||groupItem.id==group.id }">style="color:red;font-weight:bold;"</c:if>
					href="/group/newsView<c:out value='${context.postfix}'/>?gid=<c:out value='${groupItem.id }'/>"><c:if
														test="${not empty groupItem.pic&&fn:indexOf(groupItem.pic,'upload')!=-1 }">
														<img src="/${groupItem.pic}" width=12 border=0 />
													</c:if><c:if
														test="${empty groupItem.pic||fn:indexOf(groupItem.pic,'upload')==-1 }">
														<img src="/group/images/info.gif" width=12 border=0 />
													</c:if><c:out
					value='${groupItem.name }' /></a>
			</c:if> <c:if test="${context.encryptedUrl1}">
				<c:set var='urlFragmentStr' value='?gid=${groupItem.id}' />
				<c:set var='urlFragment'
					value='${grouptalk:getEncryptedStr(urlFragmentStr)}' />
				<a
					<c:if test="${groupItem.id==param.gid||groupItem.id==group.id }">style="color:red;font-weight:bold;"</c:if>
					href="/group/newsView<c:out value='${context.postfix }'/>/~<c:out value='${urlFragment}'/>"><c:if
														test="${not empty groupItem.pic&&fn:indexOf(groupItem.pic,'upload')!=-1 }">
														<img src="/${groupItem.pic}" width=12 border=0 />
													</c:if><c:if
														test="${empty groupItem.pic||fn:indexOf(groupItem.pic,'upload')==-1 }">
														<img src="/group/images/info.gif" width=12 border=0 />
													</c:if><c:out
					value='${groupItem.name }' /></a>
			</c:if></td>
		</tr>
	</c:forEach>
</table>

</div>
</body>
</html>

